package mashibing.class11;

/**
 * 折线问题（微软算法面试题）
 *
 * @author yujiafan
 * @version 1.0.0
 * @create 2023-05-17
 */
public class Class11_7_PaperFolding {

    // n折多少次,相当于层数
    public static void paperFolding(int N) {
        process(1, N, true);
    }

    private static void process(int level, int N, boolean flag) {
        if(level > N){
            return;
        }
        // 左折线为凹
        process(level + 1,N,true);
        System.out.print(flag ? "凹 " : "凸 ");
        // 右折线为凸
        process(level + 1,N,false);
    }

    public static void main(String[] args) {
        // 凹 凹 凸 凹 凹 凸 凸 凹 凹 凹 凸 凸 凹 凸 凸
        paperFolding(4);
    }
}
